package com.tuling.jvm.classloader;

/**
 * Created by chenhs on 2018/7/31.
 *
 * 类加载器的树状组织结构：
 * sun.misc.Launcher$AppClassLoader@18b4aac2
 * sun.misc.Launcher$ExtClassLoader@2d363fb3
 * null
 *
 */
public class ClassLoaderTree {
    public static void main(String[] args) {
        ClassLoader loader = ClassLoaderTree.class.getClassLoader();
        while (true) {
            System.out.println(loader.toString());
            loader = loader.getParent();
            if (loader == null){
                loader = null;
                System.out.println(loader);
                break;
            }
        }
    }
}
